#ifndef __WAVE_OBJ_H__
#define __WAVE_OBJ_H__

#include "Assembly.h"
#include "Face.h"
#include "Matrix4D.h"

#include <iostream>
#include <sstream>
#include <vector>

using std::vector;
using std::istream;
using std::stringstream;

// just a wrapper to the real obj-root
//	since it has to be centered on the origin
class WaveObj : public Assembly
{
public:
	// ctor
	WaveObj(istream& is);
	
	// dtor
	virtual ~WaveObj();
	
private:
	void parse(istream& is);
	void getO();
	void getF();
	void getU();
	void getVs();
	void getV();
	void getVN();
	void getM();
	
	Face* getFace(stringstream& ss);
	
	vector<Vertex*> m_vertex;
	vector<Vertex*> m_normal;
	
	istream* m_is;
	string m_buf;
	string m_act_material;
	Assembly* m_act_part;
	Assembly* m_root;
	
	list<Face*> m_shadow_face;
	vector<Vertex*> m_shadow_normal;
	
	// bounding box
	float m_xmin, m_xmax, m_ymin, m_ymax, m_zmin, m_zmax;
};

#endif

